

<!-- 这是侧边栏 -->

<!-- 未登录 -->
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<nav th:fragments="nav">
<!-- <c:if test="${empty USER}"> -->

    <div class="panel panel-default" id="sidebar2" style="width: 20%;margin:1% 2% 1% 0%;float: right" th:if="${session.user==null}">
        <div class="panel-heading" style="background-color: white;text-align: center">
            <blockquote>
                逍遥论坛
                <small>一个小论坛</small>
            </blockquote>
        </div>
        <ul class="list-group" style="width: 100%">
            <li class="list-group-item">
                <a  href="toLoginPage.do" class="btn btn-primary btn-block">登录</a>
                <a  href="toSignUpPage.do" class="btn btn-default btn-block">注册</a>
            </li>
        </ul>
    </div>
<!-- </c:if> -->

<!-- 已登录 -->
<!-- <c:if test="${!empty USER}"> -->

    <div class="panel panel-default" id="sidebar2" style="width: 20%;margin:1% 2% 1% 0%;float: right" th:if="${session.user!=null}" th:object="${session.user}">
        <div class="panel-heading" style="background-color: white;text-align: center">欢迎您！
            <a th:href="'getUserInfo.do?userId='+${session.user.userId}"  th:text="*{userNick}">

                <!--<c:choose>
                    <c:when test="${empty USER.user_nick}">${USER.user_name}</c:when>
                    <c:otherwise>${USER.user_nick}</c:otherwise>
                </c:choose>-->
            </a>
            <div th:switch="*{userType}">
                <span class="label label-primary" th:case="0">超级管理员</span>
                <span class="label label-primary" th:case="1">管理员</span>
                <span class="label label-primary" th:case="*">普通用户</span>
               <!-- <c:choose>
                    <c:when test="${USER.user_type == 0}">超级管理员</c:when>
                    <c:when test="${USER.user_type == 1}">管理员</c:when>
                    <c:otherwise>普通用户</c:otherwise>
                </c:choose>-->

            </div>

        </div>
        <ul class="list-group" style="width: 100%">
            <!-- 被锁定的用户不能发贴 -->
          <!--  <c:if test="${USER.user_status != 2}">-->
                <li class="list-group-item" th:if="*{userStatus!=2}">
                    <a href="toPublishTipPage.do">发表新贴</a>
                </li>
            <!--</c:if>
            <c:if test="${USER.user_type == 0}">-->
                <li class="list-group-item" th:if="*{userType==0}">
                    <a href="toSignUpPage.do">注册新的管理员</a>
                </li>
        <!--    </c:if>-->
            <li class="list-group-item"><a href="#">待添加</a></li>
        </ul>
    </div>
<!-- </c:if> -->

</nav>
